import qs from 'qs'
import request from '@/utils/request'
// 签名
import _bale from '@/utils/package'
// 获取不同的接口地址
// import { ssoApi } from '@/api/index'
// 微信参数
export function getProductList(params) {
  return request({
    url: '/app/index/get_find_goods_list',
    method: 'post',
    data: qs.stringify(_bale('get_find_list', params))
  })
}

// 获取商品详情
export function getGoodsDetails(params) {
  return request({
    url: '/app/index/get_find_goods_details',
    method: 'post',
    data: qs.stringify(_bale('get_find_goods_details', params))
  })
}
// 添加分享商品至购物车
export function addShopCart(params) {
  return request({
    url: '/app/index/add_find_shop_cart',
    method: 'post',
    data: qs.stringify(_bale('add_find_shop_cart', params))
  })
}
// 获取购物车商品列表
export function getCartProductList(params) {
  return request({
    url: '/mallGoods/getShopCart',
    method: 'post',
    data: qs.stringify(_bale('getShopCart', params))
  })
}

// 修改购物车的数量
export function updateProCount(params) {
  return request({
    url: '/mallGoods/updateShopCart',
    method: 'post',
    data: qs.stringify(_bale('updateShopCart', params))
  })
}

// 删除购物车尺码
export function delCartPro(params) {
  return request({
    url: '/mallGoods/deleteShopCart',
    method: 'post',
    data: qs.stringify(_bale('deleteShopCart', params))
  })
}
// 购物车结算验证商品库存
export function validateCartNum(params) {
  return request({
    url: '/mallGoods/validateShopCart',
    method: 'post',
    data: qs.stringify(_bale('deleteShopCart', params))
  })
}
// 设置购物车key
export function submitCartPro(params) {
  return request({
    url: '/mallGoods/setCartKey',
    method: 'post',
    data: qs.stringify(_bale('setCartKey', params))
  })
}

// 获取商品尺码信息
export function getSpecInfo(params) {
  return request({
    url: '/app/index/get_find_goods_spec',
    method: 'post',
    data: qs.stringify(_bale('get_find_goods_spec', params))
  })
}

// 确认采购/一件代发 订单
export function getConfirmOrder(params) {
  return request({
    url: '/app/index/confirm_find_order',
    method: 'post',
    data: qs.stringify(_bale('confirm_find_order', params))
  })
}
// 分享商品提交订单
export function submitOrder(params) {
  return request({
    url: '/app/index/submit_find_order',
    method: 'post',
    data: qs.stringify(_bale('submit_find_order', params))
  })
}
// 获取支付订单信息
export function getPayOrder(params) {
  return request({
    url: '/order/payOrder',
    method: 'post',
    data: qs.stringify(_bale('payOrder', params))
  })
}
// 支付

export function payOrder(params) {
  return request({
    url: '/pay/appPay',
    method: 'post',
    data: qs.stringify(_bale('appPay', params))
  })
}
// 查询交易订单

export function getOrderInfo(params) {
  return request({
    url: '/order/getOrderInfo',
    method: 'post',
    data: qs.stringify(_bale('getOrderInfo', params))
  })
}

// 获取物流公司
export function getLogisticsCompany(params) {
  return request({
    url: '/return/getLogisticsCompany',
    method: 'post',
    data: qs.stringify(_bale('getLogisticsCompany', params))
  })
}
// 提交退货凭证
export function addReturnVoucher(params) {
  return request({
    url: '/return/addReturnVoucher',
    method: 'post',
    data: qs.stringify(_bale('addReturnVoucher', params))
  })
}
